import request from '@/config/axios'

// 车辆费用记录 VO
export interface VehicleExpenseVO {
  id: number // 费用记录ID
  expenseDate: Date // 费用日期
  expenseType: string // 费用类型
  expenseAmount: number // 费用金额(元)
  expenseSubject: string // 费用主题
  vehicleName: string // 车辆名称
  licensePlate: string // 车牌号码
  handlerId: string // 跟进人
}

// 车辆费用记录 API
export const VehicleExpenseApi = {
  // 查询车辆费用记录分页
  getVehicleExpensePage: async (params: any) => {
    return await request.get({ url: `/oa/vehicle-expense/page`, params })
  },

  // 查询车辆费用记录详情
  getVehicleExpense: async (id: number) => {
    return await request.get({ url: `/oa/vehicle-expense/get?id=` + id })
  },

  // 新增车辆费用记录
  createVehicleExpense: async (data: VehicleExpenseVO) => {
    return await request.post({ url: `/oa/vehicle-expense/create`, data })
  },

  // 修改车辆费用记录
  updateVehicleExpense: async (data: VehicleExpenseVO) => {
    return await request.put({ url: `/oa/vehicle-expense/update`, data })
  },

  // 删除车辆费用记录
  deleteVehicleExpense: async (id: number) => {
    return await request.delete({ url: `/oa/vehicle-expense/delete?id=` + id })
  },

  // 导出车辆费用记录 Excel
  exportVehicleExpense: async (params) => {
    return await request.download({ url: `/oa/vehicle-expense/export-excel`, params })
  }
}